feat: TMDB collections in Details (rebased) - #143
Conversation
There was a problem hiding this comment.
Pull request overview
Adds TMDB collection/franchise support to the Details experience so movie detail pages can surface collection metadata, related titles, and a route into the app’s collection flow.
Changes:
- Extend TMDB/detail data loading to fetch a movie’s
belongs_to_collectionreference and collection items. - Add Details UI support for collection sections, focus/navigation handling, and a new “View Collection” action.
- Wire Details navigation into the existing collection-details destination.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
app/src/main/res/values/strings.xml |
Adds the new collection button label. |
app/src/main/kotlin/com/arflix/tv/ui/screens/details/DetailsViewModel.kt |
Stores TMDB collection metadata and items in details UI state. |
app/src/main/kotlin/com/arflix/tv/ui/screens/details/DetailsScreen.kt |
Adds collection UI, focus logic, button handling, and collection-item navigation. |
app/src/main/kotlin/com/arflix/tv/navigation/AppNavigation.kt |
Passes collection navigation from Details into app navigation. |
app/src/main/kotlin/com/arflix/tv/data/repository/MediaRepository.kt |
Adds repository helpers for TMDB collection lookup and item loading. |
app/src/main/kotlin/com/arflix/tv/data/api/TmdbApi.kt |
Extends TMDB movie details models with collection reference data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| val collectionId = uiState.collectionId | ||
| if (collectionId != null) { | ||
| onNavigateToCollection(collectionId.toString()) | ||
| } |
| if (collectionItems.isNotEmpty()) { | ||
| Box(modifier = Modifier.clickable { onButtonClick(5) }) { | ||
| PremiumActionButton( | ||
| icon = Icons.Default.Star, | ||
| text = stringResource(R.string.view_collection), | ||
| isFocused = focusSectionForUi == FocusSection.BUTTONS && buttonIndex == 5, | ||
| isIconOnly = true | ||
| ) |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
| when (section) { | ||
| FocusSection.BUTTONS -> if (buttonIdx < 4) setButton(buttonIdx + 1) | ||
| FocusSection.BUTTONS -> { | ||
| val maxButton = if (uiState.collectionId != null) 5 else 4 |
| collectionItems: List<MediaItem> = emptyList(), | ||
| collectionName: String? = null, | ||
| collectionIndex: Int = 0, |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
| var collectionIndex by remember { mutableIntStateOf(0) } | ||
| var suppressSelectUntilMs by remember { mutableLongStateOf(0L) } |
| Column { | ||
| val displayName = collectionName ?: stringResource(R.string.more_like_this) | ||
| Text( | ||
| text = "$displayName Collection", |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Not ready to merge yet. This still conflicts with GitHub main in DetailsScreen.kt, so it needs a rebase/manual conflict resolution first. Also the View Collection fix still looks wrong: it passes the raw TMDB collection id into CollectionDetailsScreen, but that screen loads from CatalogRepository by catalog id. That will likely show “Collection not found” for TMDB franchise ids. Please add a real TMDB collection route/screen mode, or adapt CollectionDetailsScreen to load TMDB collection ids directly. |
…collections # Conflicts: # app/src/main/kotlin/com/arflix/tv/ui/screens/details/DetailsScreen.kt
Summary
Recreated from GitLab MR #79 and rebased onto current
main.This PR adds TMDB movie collection support on the Details page and includes the collection routing/UX fixes needed for a clean merge.
Included Changes
hasCollectiondeclaration scopeCollectionDetailsusingcollectionIdWhy
The original GitLab MR was never merged. This recreates the intended feature/fixes on top of current GitHub
main.Validation
git diff --checkagainstupstream/main...mr-79-clean: clean25.0.2)::app:compilePlayDebugKotlin:app:compileSideloadDebugKotlinPlease run compile checks in CI or local Android SDK.